input {
    &[type='radio'] {
        padding: 0;
        width: $--radio-size-default;
        height: $--radio-size-default;
        border-radius: 100%;
    }
}

.foxui-radio {
    display: flex;
    align-items: center;
    color: $--color-text-regular;
    font-weight: 500;
    font-size: $--font-size-base;
    position: relative;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    user-select: none;

    .foxui-radio-input {
        white-space: nowrap;
        cursor: pointer;
        outline: none;
        display: inline-block;
        line-height: 1;
        position: relative;
        vertical-align: middle;

        .foxui-radio-icon {
            border: $--border-base;
            border-radius: 100%;
            width: $--radio-size-default;
            height: $--radio-size-default;
            background-color: $--color-white;
            position: relative;
            cursor: pointer;
            display: inline-block;

            &::after {
                content: '';
                width: $--radio-size-default - 2;
                height: $--radio-size-default - 2;
                border-radius: 100%;
                background-color: $--color-primary-light-2;
                border: $--color-white $--border-radius-small $--border-style-base;
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%) scale(0);
                transition: transform 0.15s ease-in;
            }
        }

        input {
            opacity: 0;
            outline: none;
            position: absolute;
            margin: 0;
            width: 0;
            height: 0;
            z-index: -1;
        }
    }

    .foxui-radio-label {
        margin-left: $--padding-extra-small / 2;
    }

    &.is-checked {
        .foxui-radio-input {
            .foxui-radio-icon {
                background-color: $--color-primary-light-2;
                border-color: $--color-primary-light-2;

                &::after {
                    transform: translate(-50%, -50%) scale(1);
                }
            }
        }
    }

    &:hover {
        .foxui-radio-icon {
            border-color: $--color-primary-light-1;
        }
    }

    & + .foxui-radio {
        margin-left: $--padding-large;
    }

    &.is-disabled {
        cursor: not-allowed;

        .foxui-radio-input {
            cursor: not-allowed;

            .foxui-radio-icon {
                cursor: not-allowed;
                border-color: $--radio-disabled-border-color;
                background-color: $--radio-disabled-input-fill;

                &::after {
                    background-color: $--radio-disabled-icon-color;
                }
            }
        }

        .foxui-radio-label {
            color: $--radio-disabled-icon-color;
        }
    }
}
